home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / allfil.zip / SCREEN.LIB < prev   
Text File  |  1984-12-02  |  2KB  |  51 lines

  1. {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
  2. The purchaser of these procedures and functions may include them in COMPILED
  3. programs freely, but may not sell or give away the source text.
  4.  
  5.    NOTE: in order to use the following procedures and functions, your
  6.          program must also include MONITOR.LIB, and it must simply
  7.          call the procedure CheckColor.  If you don't do this, the
  8.          routines in this file will work erratically, if at all   }
  9.  
  10. var
  11.   LocationCode : integer;
  12. {============================================================================}
  13. function ReadScreen(col,row:byte):char;
  14.  
  15. {Returns the character on the screen at co-ordinate (col,row) }
  16.  
  17.   begin
  18.     LocationCode := (col-1)*2 + (row-1)*160;
  19.     ReadScreen   := chr(Mem[ScreenSeg:LocationCode]);
  20.   end;
  21. {============================================================================}
  22. procedure WriteScreen(col, row: byte; thisChar:char; attribute : byte);
  23.  
  24. {Writes the character "thisChar" directly to the screen at co-ordinates
  25.  (col,row), with the attribute indicated}
  26.  
  27. begin
  28.   LocationCode := (col-1)*2 + (row-1)*160;
  29.   Mem[ScreenSeg:locationCode] := ord(ThisChar);
  30.   LocationCode := (col-1)*2+1 + (row-1)*160;
  31.   Mem[ScreenSeg:locationCode] := attribute;
  32. end;
  33. {============================================================================}
  34. procedure ScreenAttribute(col, row, attribute: byte);
  35.  
  36. {Changes the attribute on the screen at (col,row) w/o changing the character}
  37.  
  38. begin
  39.   LocationCode := (col-1)*2+1 + (row-1)*160;
  40.   Mem[ScreenSeg:locationCode] := attribute;
  41. end;
  42. {============================================================================}
  43. function GetAttribute(col,row:byte):byte;
  44.  
  45. {Returns the screen attribute at (col,row)}
  46.  
  47. begin
  48.   LocationCode := (col-1)*2+1 + (row-1)*160;
  49.   GetAttribute := Mem[ScreenSeg:LocationCode];
  50. end;
  51.